package com.zzxy.spring.service.impl;

import com.zzxy.spring.dao.IStudentDao;
import com.zzxy.spring.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("stuService")
 public class StudentServiceImpl implements IStudentService {
    @Autowired
   private IStudentDao studentDao;

  /*  public IStudentDao getStudentDao() {

        return studentDao;
    }

    public void setStudentDao(IStudentDao studentDao) {

        this.studentDao = studentDao;
    }*/

    public void addStudent(String username, String password) {
        studentDao.addStudent(username,password);
    }

    @Override
    public int updatesStudent(int id) {
     // try {
        //  System.out.println("update student...");
        //  int i = 1 / 0;
     // }catch (Exception e){
       //   System.out.println(e.getMessage());
         // //write to log
         // throw new RuntimeException(e);
     // }
        System.out.println("update student...");
        int i = 1 / 0;
        return id;
    }

    @Override
    public void deleteStudent(int id) {

    }

    @Override
    public void deleteStudent() {
        System.out.println("delete student...");
    }

    @Override
    public void updateStudent(int i) {

    }


}
